import { useNavigate } from "react-router-dom";

export const isOnline = () => {
  //   const navigate = useNavigate();
  let flag;
  if (window.navigator.onLine) {
    flag = true;
    console.log("网络正常！");
  } else {
    flag = false;
    console.log("网络中断！");
  }
  return flag;
};
